using System;
using System.Globalization;
using Avalonia.Data.Converters;
using Avalonia.Layout;

namespace AnimationPage.Converters;

public sealed class SentByMeToAlignmentConverter : IValueConverter
{
    public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
    {
        if (parameter == null)
            return (bool)value ? HorizontalAlignment.Right : HorizontalAlignment.Left;
        else
            return (bool)value ? HorizontalAlignment.Left : HorizontalAlignment.Right;
    }

    public object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
    {
        throw new NotImplementedException();
    }
}